package com.sui.bigdata.sml.web.misc.websocket;

import javax.websocket.Session;

/**
 * @Author songhaicheng
 * @Date 2019/8/26 19:42
 * @Description
 * @Reviewer
 */
public class ExperimentStatusClient {

    private String eid;
    private Session session;

    public String getEid() {
        return eid;
    }

    public void setEid(String eid) {
        this.eid = eid;
    }

    public Session getSession() {
        return session;
    }

    public void setSession(Session session) {
        this.session = session;
    }

    public ExperimentStatusClient(String eid, Session session) {
        this.eid = eid;
        this.session = session;
    }

    @Override
    public int hashCode() {
        return (eid + "_" + session.getId()).hashCode();
    }

    @Override
    public boolean equals(Object o) {
        if (o == null) {
            return false;
        }
        if (this == o) {
            return true;
        }
        if (o instanceof ExperimentStatusClient) {
            return this.hashCode() == o.hashCode();
        }
        return false;
    }

}
